package cn.snow.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuwanxiang
 * @version 2018/3/13
 */
@RestController
public class InterfaceController {

    @Autowired
    private HiController hiController;

    @Autowired
    private HelloController helloController;

    @GetMapping("/interface/{servletName}")
    public Object interfaceServlet(@PathVariable String servletName){
        if ("hello".equals(servletName)){
            return helloController.hello();
        }else{
            return hiController.hi();
        }

    }

}